package com.market.common.controller;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.market.common.anno.SampleAnnotation;
import com.market.common.service.BaseService;
import com.market.user.vo.UserVo;

@Controller
@RequestMapping("/sample")
public class SampleController {
	
	private static Logger logger = Logger.getLogger(SampleController.class);
	
	@Autowired
	private BaseService baseService;

	@SampleAnnotation(value="rrrrrr")
	@ResponseBody
	@RequestMapping(value = "/sample")
	public String sapmle(HttpServletRequest request,
			HttpServletResponse response) {
		
		UserVo user = new UserVo();
//		user.setId("1233");
		user.setUsername("wangxi");
		user.setRegisterDate(new Date());
		user.setPassword("userwefwef");
		return "callback(\"{'timestamp':'1442459851','appid':'wx3c40e9756927caf7','nonceStr':'hh','jsapi_ticket':'bxLdikRXVbTPdHSM05e5uxOlYYJIKN-8Zprn2k-Arf46d5iecLbdvk7TCdozDVhiNPRUIOB3mEZftcviNddYOg','signature':'501c58f46c448cb9e01498cdf87e6c364b40ef26','url':'http://localhost:8080/amway-ecard/wechatController/toAddWechatCard.jhtml?cardnum=&codes=15080067000478,15080067000477'}\");";
	}
	
	@RequestMapping(value = "/sapmleJsp")
	public String sapmleJsp(HttpServletRequest request,
			HttpServletResponse response, String id) {
		logger.info("wgawgegearg");
		return "index";
	}
	
}
